package org.zn.note.jdk.beans;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @ClassName User
 * @Author zn
 * @Date 2019/8/30 14:49
 **/
public class User implements Serializable {

    private Long userId;
    private String userName;
    private Integer age;
    private Date birthday;

    public User() {
    }

    public User(Long userId, String userName, Integer age, Date birthday) {
        this.userId = userId;
        this.userName = userName;
        this.age = age;
        this.birthday = birthday;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String toString() {
        StringBuilder buffer = new StringBuilder();
        buffer.append("userId:").append(userId).append(",");
        buffer.append("userName:\"").append(userName).append("\",");
        buffer.append("age:").append(age).append(",");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        buffer.append("birthday:").append(sdf.format(birthday)).append(",");
        return buffer.toString();
    }
}
